package com.amt.basic.controller;


import com.amt.basic.service.GoodsService;
import com.amt.configure.ControllerLog;
import com.amt.configure.ResultMsg;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "商品相关接口")
@RestController
@RequestMapping("ec_goods")
public class GoodsSubscribeController {
    @Autowired
    private GoodsService goodsService;

    @ApiOperation(value = "商品服务-商品信息变更", notes = "信息变更")
    @ApiResponses({
            @ApiResponse(code = 0, message = "接受成功", response = ResultMsg.class),
            @ApiResponse(code = 1, message = "接收失败", response = ResultMsg.class)})
    @PostMapping("/goodsUpdate")
    @ControllerLog("售价格变更")
    public String goodsUpdate(@RequestBody String param) {
        return goodsService.goodsUpdate(param);
    }

    @ApiOperation(value = "商品服务-商品删除", notes = "商品删除")
    @ApiResponses({
            @ApiResponse(code = 0, message = "接受成功", response = ResultMsg.class),
            @ApiResponse(code = 1, message = "接收失败", response = ResultMsg.class)})
    @PostMapping("/goodsDelete")
    @ControllerLog("售价格变更")
    public String goodsDelete(@RequestBody String param) {
        return goodsService.goodsDelete(param);
    }
}
